<!--
 * @Author: your name
 * @Date: 2021-10-26 19:35:00
 * @LastEditTime: 2021-10-26 19:54:03
 * @LastEditors: Please set LastEditors
 * @Description: 实现同步promise
 * @FilePath: \implement-promise-manually\src\index.html
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./promise.js"></script>
</head>

<body>

</body>
<script>
    let p = new MyPromise((resolve, reject) => {
           resolve("OK"); //-- 状态成功,结果为ok
        // reject("Error")   --状态失败。结果为error
        // throw "Error"     --状态失败。结果为error
    });
    let p1 = new Promise((resolve,reject) =>{
        resolve("OK")
    })
    console.log(p);
</script>

</html>